    <div class="row">
        <div class="col-xs-12">
        <!-- /.box -->
            <div class="box">
                <div class="box-header">
                            <div id='SearchForm'>
                                <div class="row " style="line-height:33px; display: flex;">
                                    <div class="col-xs-4">
                                       <label class="col-xs-4"> 用户名:</label>
                                    <input type="text" class="form-control" name="username" style='width:150px;'
                                    value="<?php echo (isset($search['username'])?$search['username']:'') ?>">
                                    </div>
                                    <div class="col-xs-4">
                                        <label class="col-xs-4">品牌:</label>
                                        <select name="brand_id" style='width:150px;' class='form-control'>
                                            <option value="">请选择</option>
                                            <?php
                                            foreach ($brand_opts as $key => $opts) {
                                            ?>
                                                <option value="<?=$opts['id'] ?>" <?php if(isset($search['brand_id']) && $search['brand_id'] == $opts['id']) echo 'selected';?>><?=$opts['name'] ?></option>
                                            <?php
                                            }
                                            ?>
                                        </select>
                                    </div>
                                    <div class="col-xs-4">
                                        <label class="col-xs-4">权限组:</label>
                                        <select name="permis_id" style='width:150px;' class='form-control'>
                                            <option value="">请选择</option>
                                            <?php
                                            foreach ($permis_opts as $key => $opts) {
                                            ?>
                                                <option value="<?=$opts['id'] ?>" <?php if(isset($search['permis_id']) && $search['permis_id'] == $opts['id']) echo 'selected';?>><?=$opts['name'] ?></option>
                                            <?php
                                            }
                                            ?>
                                        </select>
                                    </div>
                                    <div class="col-xs-3">
                                        &nbsp;&nbsp;&nbsp;&nbsp;
                                        <input type="button" id='searchBtn' class='btn btn-default' value='搜索'>
                                        &nbsp;
                                        <input type="button" id='createBtn' class='btn btn-primary bg-pink' value='新建'>

                                    </div>

                                    <!-- <div class="col-xs-12">
                                        <div class="col-xs-4">
                                            <label class="col-xs-4" style="min-width">
                                               用户名:
                                            </label>
                                            <input type="text" class="form-control" name="username" style='width:150px;'
                                    value="<?php echo (isset($search['username'])?$search['username']:'') ?>">
                                        </div>
                                        <div class="col-xs-3">1111</div>
                                        <div class="col-xs-3">1111</div>
                                        <div class="col-xs-2">111</div>

                                    </div> -->
                                </div>
                            </div>

                </div>
                <div class="box-body">
                    <table class="table table-bordered text-center">
                        <thead>
                        <tr>
                            <th nowrap>序号</th>
                            <th nowrap>用户名</th>
                            <th nowrap>名称</th>
                            <th nowrap>邮件</th>
                            <th nowrap>部门</th>
                            <th nowrap>品牌</th>
                            <th nowrap>权限组</th>
                            <th nowrap>是否管理员</th>
                            <th nowrap>最后操作时间</th>
                            <th nowrap  >操作</th>
                        </tr></thead>
                        <tbody>
                            <?php
                            foreach ($userlist as $key=>$user) {
                            ?>
                                <tr style='text-align: center;'>
                                    <td><?= $key+1 ?></td>
                                    <td><?= $user['name']?></td>
                                    <td><?= $user['user_name']?></td>
                                    <td><?= $user['email']?></td>
                                    <td><?= $user['group_name']?></td>
                                    <td><?= $user['brand_name']?></td>
                                    <td><?= $user['permis_name']?></td>
                                    <td>
                                        <?php if($this->permis_logic->isAdmin($user) == 'yes'){?>
                                            是
                                        <?php }else{?>
                                            否
                                        <?php }?>
                                    </td>
                                    <td><?= $user['update_time']?></td>
                                    <td nowrap>
                                        <a class="btn btn-default btn-xs btn-flat margin" href='edit/<?= $user['id']?>' tag='edit_link'>编辑</a>
                                        <?php if(1 != $user['id']){?>
                                        <a class="btn btn-default btn-xs btn-flat margin" href='enable/<?= $user['id']?>?status=<?=$user['status']?>' tag='enable_link'>
                                            <?php if(1 == $user['status']){?>
                                                禁用
                                            <?php }else{?>
                                                启用
                                            <?php }?>
                                        </a>
                                        <!-- <a class="btn btn-default btn-xs btn-flat margin" href='destroy/<?= $user['id']?>' tag='delete_link'>删除</a> -->
                                        <?php }?>
                                        <a class="btn btn-default btn-xs btn-flat margin" href='resetpwd/<?= $user['id']?>' tag='resetpwd_link'>重置密码</a>
                                    </td>
                                </tr>
                            <?php
                            }
                            ?>
                            <tr>
                                <td colspan="9" style='text-align: right;display: none;'>
                                    <span style='word-spacing:8px; letter-spacing: 10px;' id='paginate'>
                                        <?=$paginate?>
                                    </span>
                                </td>
                            </tr>
                    </tbody></table>
                </div>
                <!-- /.box-body -->
                <div class="box-footer clearfix">
                    <ul class="pagination pagination-sm no-margin pull-right" id='paginateul'></ul>
                    <span class='no-margin pull-right' style='padding-right:40px;'><?=$pagetitle?></span>
                </div>
            </div>
        </div>
    <!-- /.col -->
    </div>
<!-- /.row -->
<script>
$(function(){
    var is_submit = 1;
    $('a[tag=delete_link]').on('click',function(){
        if(confirm('确定要删除吗？')){
            return true;
        }
        return false;
    });
    $('#createBtn').on('click',function (){
        location.href = 'create';
    });
    $('#searchBtn').on('click',function(){
        var param = {};
        $('#SearchForm input[name],select[name]').each(function(){
            if($(this).val() != ''){
                param[$(this).attr('name')] = $(this).val();
            }
        });
        param['cur_page'] = 1;
        searchList(param);
    });
    $('#SearchForm input[name]').on({
        'keypress':function (event){
            var e = window.event||event;
            if(13 == e.keyCode){
                $('#searchBtn').click();
            }
        }
    });
    //将ci的分页放到新的版本中去
    if($('#paginate a').length > 0){
        var paginateul = '';var link_href = '';var link_val = '';
        $('#paginate a,strong').each(function (){
            link_val = $(this).html();
            link_href = $(this).attr('href');
            if(link_href != undefined){
                if('Last ›' == link_val){
                    link_val = '>>';
                }else if('‹ First' == link_val){
                    link_val = '<<';
                }
                paginateul += '<li><a href="'+link_href+'">'+link_val+'</a></li>';
            }else{
                paginateul += '<li><a href="#" onclick="return false;" style="color:#428bca;"><b>'+link_val+'</b></a></li>';
            }
        });
        $('#paginateul').html(paginateul);
        //绑定分页事件
        $('#paginateul').on('click','a[href]',function(){
            var url = $(this).attr('href');
            if('#' == url) return false;
            var urlarr = url.split('=');
            var cur_page = urlarr[urlarr.length-1];
            if(isNaN(cur_page)) cur_page = 1;
            var param = {};
            $('#SearchForm input[name],select[name]').each(function(){
                if($(this).val() != ''){
                    param[$(this).attr('name')] = $(this).val();
                }
            });
            param['cur_page'] = parseInt(cur_page);
            searchList(param);
            return false;
        });
    }
});
</script>
